<?php
//引入数据库连接文件
include("conn.php");
// 获取POST请求的参数
$account = $_POST['account'];
$password = $_POST['password'];
//dingyi SQL
$sql ="select id from user where account='$account' and password ='$password' ";
// 执行sql语句
$result = $conn -> query($sql);
//huoqu 结果
if ($result -> num_rows > 0){
	//开启Session
	session_start();
	// cunzhu
	$_SESSION["user.account"]= $account;
	// 释放结果集
	$result -> free_result();
	//关闭连接
	$conn -> close();
	//跳转首页
	header("location:../index.php");
}else{
	$result -> free_result();
	$conn -> close();
	header("location:../login.php?message=用户名或密码不一致");
}